{extend name="$_admin_base_layout" /}
{block name="style"}
<style>
    .filtrate .dropdown-menu {
        max-width: 80px;
        min-width: 80px;
    }
</style>
{/block}
{block name="content"}
<div class="row">
    <div class="col-md-12">
        <div class="block block-rounded">
            <div class="block-header">
                <div class="col-md-6">
                    <form class="form-inline" method="get">
                        <div class="form-group">
                            按日期统计：
                        </div>
                        <div class="input-daterange input-group " data-date-format="mm/dd/yyyy">
                            <input class="form-control" type="text" id="begin_time"
                                   value="{:input('begin_time',date('Y-m-d',strtotime('-6 days')))}" name="begin_time" placeholder="From">
                            <span class="input-group-addon"><i class="fa fa-chevron-right"></i></span>
                            <input class="form-control" type="text" id="end_time"
                                   value="{:input('end_time',date('Y-m-d'))}" name="end_time" placeholder="To">
                        </div>
                        <div class="form-group">
                            <button class="btn btn-default" type="submit">查询</button>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>

<div class="row">
    <div class="col-sm-6 col-md-6">
        <div class="block block-link-hover3 text-center">
            <div class="block-content block-content-full">
                <span class="h3 font-w700 text-success"> {$info.order_succeed_qty}</span>
                <span class="h3 font-w700">/</span>
                <span class="h3 font-w700 text-primary"> {$info.order_qty}</span>
            </div>
            <div class="block-content block-content-full block-content-mini bg-gray-lighter text-muted font-w600">
                成功订单 / 订单总数量
            </div>
        </div>
    </div>

    <div class="col-sm-6 col-md-6">
        <div class="block block-link-hover3 text-center">
            <div class="block-content block-content-full" style="font-size: 12px">
                <span class="h3 font-w700 text-success"> {$info.order_succeed_amount} USD</span>
                <span class="h3 font-w700">/</span>
                <span class="h3 font-w700 text-info"> {$info.order_amount} USD</span>
            </div>
            <div class="block-content block-content-full block-content-mini bg-gray-lighter text-muted font-w600">
                成交金额 / 总金额
            </div>
        </div>
    </div>

</div>


<div class="row">

    <div class="col-md-6">
        <div class="block block-bordered">
            <div class="block-header bg-gray-lighter">
                <h3 class="block-title">商品销售排行</h3>
            </div>
            <div class="table-responsive">
                <table class="table table-borderless table-striped table-vcenter">
                    <thead>
                    <tr>
                        <th class="text-left">排名</th>
                        <th>商品SKU</th>
                        <th>商品图片</th>
                        <th>商品网站</th>
                        <th>商品名称</th>
                        <th class="text-right">销售数量</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="goods_list" id="goods"}
                    <tr>
                        <td class="text-left">
                            <span class="label {$goods.k<=3?'label-success':'label-default'}">{$goods.k}</span>
                        </td>
                        <td class="text-center"><strong>{$goods.sku}</strong></td>
                        <td class="text-center">
                            <div class="js-gallery"><img class="image" data-original="{$goods['image']}" src="{$goods['image']}" width="20" height="20"></div>
                        </td>
                        <td class="text-left"><a target="_blank" title="{$goods.domain}" href="http://{$goods.domain}"><strong>{$goods.domain}</strong></a>
                        </td>
                        <td class="text-left"><a title="{$goods.name}" href="javascript:void(0)"><strong>{:mb_substr($goods.name,0,20,'UTF-8')}</strong></a>
                        </td>
                        <td class="text-right"><strong>{$goods.qty}</strong></td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="col-md-6">
        <div class="block block-bordered">
            <div class="block-header bg-gray-lighter">
                <h3 class="block-title">站点销售排行</h3>
            </div>
            <div class="table-responsive">
                <table class="table table-borderless table-striped table-vcenter">
                    <thead>
                    <tr>
                        <th class="text-left">排名</th>
                        <th>站点</th>
                        <th class="text-center">成功订单数</th>
                        <th class="text-center">销售商品数</th>
                        <th class="text-center">销售额</th>
                    </tr>
                    </thead>
                    <tbody>

                    {volist name="domain_list" id="domain"}
                    <tr>
                        <td class="text-left">
                            <span class="label {$domain.k<=3?'label-success':'label-default'}">{$domain.k}</span>
                        </td>
                        <td class="text-left" style="width: 100px;"><a
                                href="http://{$domain.domain}" target="_blank"><strong>{$domain.domain}</strong></a></td>
                        <td class="text-center">{$domain.order_total}</td>
                        <td class="text-center">{$domain.qty}</td>
                        <td class="text-center">{$domain.order_amount}</td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</div>


{/block}

{block name="script"}
<script src="/static/laydate/laydate.js"></script>
<script>
    $(function () {
        laydate.render({
            elem: '#begin_time'
        });
        laydate.render({
            elem: '#end_time'
        });

    });
</script>
{/block}
